<template><div><h2 id="java容器" tabindex="-1"><a class="header-anchor" href="#java容器"><span>Java容器</span></a></h2>
<p><a href="https://blog.csdn.net/qq_42653444/article/details/105936746" target="_blank" rel="noopener noreferrer">【Java基础】 (List、Set、Map、Stack、Queue）总结_map、set、list、queue、stack-CSDN博客</a></p>
<h3 id="list" tabindex="-1"><a class="header-anchor" href="#list"><span>List</span></a></h3>
<h3 id="stack" tabindex="-1"><a class="header-anchor" href="#stack"><span>Stack</span></a></h3>
<h3 id="queue" tabindex="-1"><a class="header-anchor" href="#queue"><span>Queue</span></a></h3>
<ul>
<li>
<p>BlockingQueue</p>
</li>
<li>
<p>DeQueue(Double End Queue)</p>
</li>
</ul>
<p><a href="https://blog.csdn.net/zhuhaotian1003/article/details/135256265" target="_blank" rel="noopener noreferrer">Java综合知识——JAVA中几种重要的队列、使用场景、实现方式与特点_java 队列使用-CSDN博客</a></p>
<p><a href="https://blog.csdn.net/footless_bird/article/details/130627354" target="_blank" rel="noopener noreferrer">BlockingQueue（阻塞队列）基本使用指南-CSDN博客</a></p>
<h3 id="set" tabindex="-1"><a class="header-anchor" href="#set"><span>Set</span></a></h3>
<h3 id="map" tabindex="-1"><a class="header-anchor" href="#map"><span>Map</span></a></h3>
<h2 id="threadlocal" tabindex="-1"><a class="header-anchor" href="#threadlocal"><span>ThreadLocal</span></a></h2>
<blockquote>
<p><a href="https://zhuanlan.zhihu.com/p/390885397" target="_blank" rel="noopener noreferrer">京东一面：说出ThreadLocal的使用场景及使用方式 - 知乎</a></p>
</blockquote>
<h2 id="stream流" tabindex="-1"><a class="header-anchor" href="#stream流"><span>Stream流</span></a></h2>
<blockquote>
<p><a href="https://blog.csdn.net/qq_64847107/article/details/131997896" target="_blank" rel="noopener noreferrer">Java---Stream流技术（全网最详细）_java stream-CSDN博客</a></p>
</blockquote>
<h2 id="内部类" tabindex="-1"><a class="header-anchor" href="#内部类"><span>内部类</span></a></h2>
<h3 id="成员内部类-member-inner-class" tabindex="-1"><a class="header-anchor" href="#成员内部类-member-inner-class"><span>成员内部类(<strong>Member Inner Class</strong>)</span></a></h3>
<p>即通过声明成员的方式声明一个类</p>
<div class="language-java line-numbers-mode" data-highlighter="shiki" data-ext="java" style="background-color:#282c34;color:#abb2bf"><pre class="shiki one-dark-pro vp-code" v-pre=""><code><span class="line"><span style="color:#C678DD">public</span><span style="color:#C678DD"> class</span><span style="color:#E5C07B"> OuterClass</span><span style="color:#ABB2BF"> {</span></span>
<span class="line"><span style="color:#C678DD">    private</span><span style="color:#C678DD"> int</span><span style="color:#E06C75"> outerField</span><span style="color:#ABB2BF">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#C678DD">    public</span><span style="color:#C678DD"> class</span><span style="color:#E5C07B"> InnerClass</span><span style="color:#ABB2BF"> {</span></span>
<span class="line"><span style="color:#C678DD">        public</span><span style="color:#C678DD"> void</span><span style="color:#61AFEF"> display</span><span style="color:#ABB2BF">()</span><span style="color:#ABB2BF"> {</span></span>
<span class="line"><span style="color:#E5C07B">            System</span><span style="color:#ABB2BF">.</span><span style="color:#E5C07B">out</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">println</span><span style="color:#ABB2BF">(</span><span style="color:#98C379">"Outer Field: "</span><span style="color:#56B6C2"> +</span><span style="color:#ABB2BF"> outerField);</span></span>
<span class="line"><span style="color:#ABB2BF">        }</span></span>
<span class="line"><span style="color:#ABB2BF">    }</span></span>
<span class="line"><span style="color:#ABB2BF">}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="静态嵌套类-static-nested-class" tabindex="-1"><a class="header-anchor" href="#静态嵌套类-static-nested-class"><span>静态嵌套类(<strong>Static Nested Class</strong>)</span></a></h3>
<p>即通过声明静态成员的方式声明一个静态类,只可以访问外部类的静态成员</p>
<div class="language-java line-numbers-mode" data-highlighter="shiki" data-ext="java" style="background-color:#282c34;color:#abb2bf"><pre class="shiki one-dark-pro vp-code" v-pre=""><code><span class="line"><span style="color:#C678DD">public</span><span style="color:#C678DD"> class</span><span style="color:#E5C07B"> OuterClass</span><span style="color:#ABB2BF"> {</span></span>
<span class="line"><span style="color:#C678DD">    private</span><span style="color:#C678DD"> static</span><span style="color:#C678DD"> int</span><span style="color:#E06C75"> outerField</span><span style="color:#ABB2BF">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#C678DD">    public</span><span style="color:#C678DD"> static</span><span style="color:#C678DD"> class</span><span style="color:#E5C07B"> StaticNestedClass</span><span style="color:#ABB2BF"> {</span></span>
<span class="line"><span style="color:#C678DD">        public</span><span style="color:#C678DD"> void</span><span style="color:#61AFEF"> display</span><span style="color:#ABB2BF">()</span><span style="color:#ABB2BF"> {</span></span>
<span class="line"><span style="color:#E5C07B">            System</span><span style="color:#ABB2BF">.</span><span style="color:#E5C07B">out</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">println</span><span style="color:#ABB2BF">(</span><span style="color:#98C379">"Outer Field: "</span><span style="color:#56B6C2"> +</span><span style="color:#ABB2BF"> outerField);</span></span>
<span class="line"><span style="color:#ABB2BF">        }</span></span>
<span class="line"><span style="color:#ABB2BF">    }</span></span>
<span class="line"><span style="color:#ABB2BF">}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="局域内部类-local-inner-class" tabindex="-1"><a class="header-anchor" href="#局域内部类-local-inner-class"><span>局域内部类(<strong>Local Inner Class</strong>)</span></a></h3>
<p>即定义在成员函数内,</p>
<div class="language-java line-numbers-mode" data-highlighter="shiki" data-ext="java" style="background-color:#282c34;color:#abb2bf"><pre class="shiki one-dark-pro vp-code" v-pre=""><code><span class="line"><span style="color:#C678DD">public</span><span style="color:#C678DD"> class</span><span style="color:#E5C07B"> OuterClass</span><span style="color:#ABB2BF"> {</span></span>
<span class="line"><span style="color:#C678DD">    private</span><span style="color:#E5C07B"> Integer</span><span style="color:#E06C75"> a </span><span style="color:#56B6C2">=</span><span style="color:#D19A66"> 1</span><span style="color:#ABB2BF">;</span></span>
<span class="line"><span style="color:#C678DD">    public</span><span style="color:#C678DD"> void</span><span style="color:#61AFEF"> doSomething</span><span style="color:#ABB2BF">()</span><span style="color:#ABB2BF"> {</span></span>
<span class="line"><span style="color:#C678DD">        class</span><span style="color:#E5C07B"> InnerClass</span><span style="color:#ABB2BF"> {</span></span>
<span class="line"><span style="color:#C678DD">            void</span><span style="color:#61AFEF"> doSomething</span><span style="color:#ABB2BF"> ()</span><span style="color:#ABB2BF"> {</span></span>
<span class="line"><span style="color:#E5C07B">                System</span><span style="color:#ABB2BF">.</span><span style="color:#E5C07B">out</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">println</span><span style="color:#ABB2BF">(a);</span></span>
<span class="line"><span style="color:#ABB2BF">            }</span></span>
<span class="line"><span style="color:#ABB2BF">        }</span></span>
<span class="line"><span style="color:#E5C07B">        InnerClass</span><span style="color:#E06C75"> innerClass</span><span style="color:#56B6C2"> =</span><span style="color:#C678DD"> new</span><span style="color:#61AFEF"> InnerClass</span><span style="color:#ABB2BF">();</span></span>
<span class="line"><span style="color:#E5C07B">        innerClass</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">doSomething</span><span style="color:#ABB2BF">();</span></span>
<span class="line"><span style="color:#ABB2BF">    }</span></span>
<span class="line"><span style="color:#ABB2BF">}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="匿名内部类" tabindex="-1"><a class="header-anchor" href="#匿名内部类"><span>匿名内部类</span></a></h3>
<blockquote>
<p><a href="https://blog.csdn.net/wang740209668/article/details/71909524" target="_blank" rel="noopener noreferrer">java语言基础(49)——匿名内部类的本质理解-CSDN博客</a></p>
</blockquote>
<p>匿名内部类的使用场景:  线程池下提交任务</p>
<p>匿名内部类可以被lambda表达式替代</p>
<div class="language-java line-numbers-mode has-collapsed-lines collapsed" data-highlighter="shiki" data-ext="java" style="--vp-collapsed-lines:15;background-color:#282c34;color:#abb2bf"><pre class="shiki one-dark-pro vp-code" v-pre=""><code><span class="line"><span style="color:#7F848E;font-style:italic">/**</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic"> * </span><span style="color:#C678DD;font-style:italic">@author</span><span style="color:#7F848E;font-style:italic"> haomingze</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic"> * </span><span style="color:#C678DD;font-style:italic">@version</span><span style="color:#7F848E;font-style:italic"> 1.0.0</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic"> * @date 2025/9/9 14:47</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic"> * @description</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic"> */</span></span>
<span class="line"><span style="color:#C678DD">public</span><span style="color:#C678DD"> class</span><span style="color:#E5C07B"> Main</span><span style="color:#ABB2BF"> {</span></span>
<span class="line"><span style="color:#C678DD">    public</span><span style="color:#C678DD"> static</span><span style="color:#C678DD"> void</span><span style="color:#61AFEF"> main</span><span style="color:#ABB2BF">(</span><span style="color:#E5C07B">String</span><span style="color:#ABB2BF">[] </span><span style="color:#E06C75;font-style:italic">args</span><span style="color:#ABB2BF">)</span><span style="color:#ABB2BF"> {</span></span>
<span class="line"><span style="color:#E5C07B">        BlockingQueue</span><span style="color:#ABB2BF">&#x3C;</span><span style="color:#E5C07B">Runnable</span><span style="color:#ABB2BF">> </span><span style="color:#E06C75">tasks</span><span style="color:#56B6C2"> =</span><span style="color:#C678DD"> new</span><span style="color:#E5C07B"> ArrayBlockingQueue</span><span style="color:#ABB2BF">&#x3C;>(</span><span style="color:#D19A66">10</span><span style="color:#ABB2BF">); </span><span style="color:#7F848E;font-style:italic">// 线程安全的队列</span></span>
<span class="line"><span style="color:#E5C07B">        ThreadPoolExecutor</span><span style="color:#E06C75"> threadPoolExecutor</span><span style="color:#56B6C2"> =</span><span style="color:#C678DD"> new</span><span style="color:#61AFEF"> ThreadPoolExecutor</span><span style="color:#ABB2BF">(</span><span style="color:#D19A66">10</span><span style="color:#ABB2BF">,</span><span style="color:#D19A66">20</span><span style="color:#ABB2BF">,</span><span style="color:#D19A66">10</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">TimeUnit</span><span style="color:#ABB2BF">.</span><span style="color:#E5C07B">SECONDS</span><span style="color:#ABB2BF">, tasks);</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic">        // 提交任务</span></span>
<span class="line"><span style="color:#E5C07B">        threadPoolExecutor</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">execute</span><span style="color:#ABB2BF">(</span><span style="color:#C678DD">new</span><span style="color:#61AFEF"> Runnable</span><span style="color:#ABB2BF">() {</span></span>
<span class="line"><span style="color:#ABB2BF">            @</span><span style="color:#E5C07B">Override</span></span>
<span class="line"><span style="color:#C678DD">            public</span><span style="color:#C678DD"> void</span><span style="color:#61AFEF"> run</span><span style="color:#ABB2BF">()</span><span style="color:#ABB2BF"> {</span></span>
<span class="line"><span style="color:#E5C07B">                System</span><span style="color:#ABB2BF">.</span><span style="color:#E5C07B">out</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">println</span><span style="color:#ABB2BF">(</span><span style="color:#98C379">"任务1执行"</span><span style="color:#ABB2BF">);</span></span>
<span class="line"><span style="color:#ABB2BF">            }</span></span>
<span class="line"><span style="color:#ABB2BF">        });</span></span>
<span class="line"><span style="color:#ABB2BF">    }</span></span>
<span class="line"><span style="color:#ABB2BF">}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div><div class="collapsed-lines"></div></div><h2 id="juc" tabindex="-1"><a class="header-anchor" href="#juc"><span>JUC</span></a></h2>
<h3 id="线程池" tabindex="-1"><a class="header-anchor" href="#线程池"><span>线程池</span></a></h3>
<blockquote>
<p><a href="https://www.cnblogs.com/jxxblogs/p/11882381.html" target="_blank" rel="noopener noreferrer">线程池提交任务的两种方式：execute与submit的区别 - 莫等、闲 - 博客园</a></p>
</blockquote>
<h2 id="jvm" tabindex="-1"><a class="header-anchor" href="#jvm"><span>JVM</span></a></h2>
<blockquote>
<p><a href="https://blog.csdn.net/TJtulong/article/details/89598598" target="_blank" rel="noopener noreferrer">深入理解java虚拟机（全章节完整）-CSDN博客</a></p>
<p><a href="https://blog.csdn.net/NoCortY/article/details/109718670" target="_blank" rel="noopener noreferrer">重识JVM（一）-类与对象在JVM中是如何存储的_jvm 类定义存在哪-CSDN博客</a></p>
<p><a href="https://zhuanlan.zhihu.com/p/444388869" target="_blank" rel="noopener noreferrer">知乎播放量最多的JVM课程《jvm性能调优+面试+实战》 - 知乎</a></p>
<p><a href="https://zhuanlan.zhihu.com/p/432258798" target="_blank" rel="noopener noreferrer">(2 条消息) 一次完整的JVM堆外内存泄漏java故障排查记录 - 知乎</a></p>
</blockquote>
<h2 id="思考" tabindex="-1"><a class="header-anchor" href="#思考"><span>思考</span></a></h2>
<ol>
<li>
<p>Java程序为什么&quot;编译一次,到处运行&quot;?</p>
<p>常规的编程语言会把直接把程序解释成机器指令(长这个样子<a href="https://blog.csdn.net/xiao__1bai/article/details/126584837" target="_blank" rel="noopener noreferrer">x86指令编码简述(机器码)_x86指令格式-CSDN博客</a>)</p>
<p>而Java程序运行依托于JVM,先把Java程序使用javac指令编译成字节码, JVM会基于当前平台把字节码编译成当前平台的机器码,再去运行.</p>
</li>
</ol>
<p>javascript this指针指向</p>
<p>function 函数this指向他所在的对象上</p>
<p>箭头函数 this指最外层</p>
</div></template>


